import { options, handleResponse } from './include'

export function getVideo(getVideo) {
    return fetch("api/video/getVideo", { ...options, body: JSON.stringify(getVideo) }).then(handleResponse)
}

export function getVideoByState(getVideoByState) {
    return fetch("api/video/getVideoByState", { ...options, body: JSON.stringify(getVideoByState) }).then(handleResponse)
}

export function getVideoInfo(getVideo) {
    return fetch("api/videoManage/getVideo", { ...options, body: JSON.stringify(getVideo) }).then(handleResponse)
}

export function updateVideo(updateVideo) {
    return fetch("api/videoManage/updateVideo", { ...options, body: JSON.stringify(updateVideo) }).then(handleResponse)
}
export function createVideo(createVideo) {
    return fetch("api/videoManage/createVideo", { ...options, body: JSON.stringify(createVideo) }).then(handleResponse)
}

export function getAllVideo(getAllVideo) {
    return fetch("api/videoManage/getAllVideo", { ...options, body: JSON.stringify(getAllVideo) }).then(handleResponse)
}

export function getAllVideoByEnable(getAllVideoByEnable) {
    return fetch("api/videoManage/getAllVideoByEnable", { ...options, body: JSON.stringify(getAllVideoByEnable) }).then(handleResponse)
}
export function deleteVideo(id) {
    return fetch("api/videoManage/deleteVideo?id=" + id, { ...options }).then(handleResponse)
}
export function getPlayVideo() {
    return fetch("api/video/getPlayVideo", { ...options }).then(handleResponse)
}